package com.iplant.pdm.service.po.bop;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.pdm.service.basicenum.fpc.FPCRouteType;

import java.io.Serializable;

/**
 * 工艺BOP【第一层】
 *
 * @author YouWang·Peng
 * 2023-7-25 15:03:58
 */
@DBBasePO(TableName = "fpc_routeparent", CheckName = {"Code", "FactoryID,LineID,ProductID,CustomerID"},
        Schemas =
        DBSchemas.PDM)
public class FPCRouteParent extends BasePO implements Serializable {
    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 工厂ID
     */
    @DBCondition
    @DBField
    public int FactoryID = 0;
    @DBJoin(name = "Code", tableName = "fmc_factory", tableAsName = "factory1", Schemas = DBSchemas.Basic,
            MainTableField = "FactoryID")
    public String FactoryCode = "";
    @DBJoin(name = "Name", tableName = "fmc_factory", tableAsName = "factory1", Schemas = DBSchemas.Basic,
            MainTableField = "FactoryID")
    public String FactoryName = "";

    /**
     * 产线ID  给了就是根据产线设置
     */
    @DBCondition
    @DBField
    public int LineID = 0;
    @DBJoin(name = "Name", tableName = "fmc_line", tableAsName = "line1", Schemas = DBSchemas.PDM,
            MainTableField = "LineID")
    public String LineName = "";
    @DBJoin(name = "Code", tableName = "fmc_line", tableAsName = "line1", Schemas = DBSchemas.PDM,
            MainTableField = "LineID")
    public String LineCode = "";

    /**
     * 产品ID
     */
    @DBCondition
    @DBField
    public int ProductID = 0;
    @DBJoin(name = "Code", tableName = "fpc_product", tableAsName = "product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductNo = "";
    @DBJoin(name = "Name", tableName = "fpc_product", tableAsName = "product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductName = "";

    /**
     * 客户ID  给了就是根据客户配置  不同客户之间不能重用
     */
    @DBCondition
    @DBField
    public int CustomerID = 0;
    @DBJoin(name = "Name", tableName = "crm_customer", tableAsName = "customer1", Schemas = DBSchemas.Basic,
            MainTableField = "CustomerID")
    public String CustomerName = "";
    @DBJoin(name = "Code", tableName = "crm_customer", tableAsName = "customer1", Schemas = DBSchemas.Basic,
            MainTableField = "CustomerID")
    public String CustomerCode = "";

    @DBJoin(name = "ProductTypeID", tableName = "fpc_product", tableAsName = "product1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public int ProductTypeID = 0;

    @DBJoin(name = "Code", tableName = "fpc_producttype", tableAsName = "producttype1", Schemas = DBSchemas.PDM,
            ConditionalJoin = "product1.ProductTypeID=producttype1.ID")
    public String ProductTypeCode = "";
    @DBJoin(name = "Name", tableName = "fpc_producttype", tableAsName = "producttype1", Schemas = DBSchemas.PDM,
            ConditionalJoin = "product1.ProductTypeID=producttype1.ID")
    public String ProductTypeName = "";


    /**
     * 工艺类型ID
     */
    @DBCondition
    @DBField
    public int TypeID = 0;

    /**
     * 工艺类型文本
     */
    public String TypeText = "";

    /**
     * 当前BOP版本ID
     */
    @DBField
    public int RouteID = 0;
    /**
     * 是否当当前标准
     */
    @DBCondition
    @DBField
    public int IsRoutID = 0;
    /**
     * 当前BOP版本名称
     */
    @DBJoin(name = "Name", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteName = "";
    /**
     * 当前BOP版本编码
     */
    @DBJoin(name = "Code", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteCode = "";
    /**
     * 当前bop版本号
     */
    @DBJoin(name = "Version", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteVersion = "";

    @JsonProperty("FactoryID")
    public int getFactoryID() {
        return FactoryID;
    }

    public void setFactoryID(int factoryID) {
        FactoryID = factoryID;
    }

    @JsonProperty("FactoryCode")
    public String getFactoryCode() {
        return FactoryCode;
    }

    public void setFactoryCode(String factoryCode) {
        FactoryCode = factoryCode;
    }

    @JsonProperty("FactoryName")
    public String getFactoryName() {
        return FactoryName;
    }

    public void setFactoryName(String factoryName) {
        FactoryName = factoryName;
    }

    @JsonProperty("LineID")
    public int getLineID() {
        return LineID;
    }

    public void setLineID(int lineID) {
        LineID = lineID;
    }

    @JsonProperty("LineName")
    public String getLineName() {
        return LineName;
    }

    public void setLineName(String lineName) {
        LineName = lineName;
    }

    @JsonProperty("LineCode")
    public String getLineCode() {
        return LineCode;
    }

    public void setLineCode(String lineCode) {
        LineCode = lineCode;
    }

    @JsonProperty("ProductID")
    public int getProductID() {
        return ProductID;
    }

    public void setProductID(int productID) {
        ProductID = productID;
    }

    @JsonProperty("ProductNo")
    public String getProductNo() {
        return ProductNo;
    }

    public void setProductNo(String productNo) {
        ProductNo = productNo;
    }

    @JsonProperty("ProductName")
    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    @JsonProperty("CustomerID")
    public int getCustomerID() {
        return CustomerID;
    }

    public void setCustomerID(int customerID) {
        CustomerID = customerID;
    }

    @JsonProperty("CustomerName")
    public String getCustomerName() {
        return CustomerName;
    }

    public void setCustomerName(String customerName) {
        CustomerName = customerName;
    }

    @JsonProperty("CustomerCode")
    public String getCustomerCode() {
        return CustomerCode;
    }

    public void setCustomerCode(String customerCode) {
        CustomerCode = customerCode;
    }

    @JsonProperty("ProductTypeID")
    public int getProductTypeID() {
        return ProductTypeID;
    }

    public void setProductTypeID(int productTypeID) {
        ProductTypeID = productTypeID;
    }

    @JsonProperty("ProductTypeCode")
    public String getProductTypeCode() {
        return ProductTypeCode;
    }

    public void setProductTypeCode(String productTypeCode) {
        ProductTypeCode = productTypeCode;
    }

    @JsonProperty("ProductTypeName")
    public String getProductTypeName() {
        return ProductTypeName;
    }

    public void setProductTypeName(String productTypeName) {
        ProductTypeName = productTypeName;
    }

    @JsonProperty("TypeID")
    public int getTypeID() {
        return TypeID;
    }

    public void setTypeID(int typeID) {
        TypeID = typeID;
    }

    @JsonProperty("TypeText")
    public String getTypeText() {
        TypeText = FPCRouteType.getEnumType(TypeID).getLabel();
        return TypeText;
    }

    public void setTypeText(String typeText) {
        TypeText = typeText;
    }

    @JsonProperty("RouteID")
    public int getRouteID() {
        return RouteID;
    }

    public void setRouteID(int routeID) {
        RouteID = routeID;
    }

    @JsonProperty("RouteName")
    public String getRouteName() {
        return RouteName;
    }

    public void setRouteName(String routeName) {
        RouteName = routeName;
    }

    @JsonProperty("RouteCode")
    public String getRouteCode() {
        return RouteCode;
    }

    public void setRouteCode(String routeCode) {
        RouteCode = routeCode;
    }

    @JsonProperty("RouteVersion")
    public String getRouteVersion() {
        return RouteVersion;
    }

    public void setRouteVersion(String routeVersion) {
        RouteVersion = routeVersion;
    }

    @JsonProperty("IsRoutID")
public int getIsRoutID() {
        return IsRoutID;
    }

    public void setIsRoutID(int isRoutID) {
        IsRoutID = isRoutID;
    }
}
